import java.util.Scanner;

/**
* @description: 牛客笔试模板
* @author hewei
* @date 2022/8/20 18:49
* @version 1.0
*/

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        String[] split = s1.split(" ");
        int n = Integer.parseInt(split[0]);
        int x = Integer.parseInt(split[1]);
        String[] s = s2.split(" ");
        int[] nums = new int[n];
        for (int i = 0; i < s.length; i++) {
            nums[i] = Integer.parseInt(s[i]);
        }
        int start = Math.max(0, nums[0] - x);
        int end = nums[0] + x;
        int ans = 0;
        for (int i = 1; i < n; i++) {
            int l = Math.max(0, nums[i] - x);
            int r = nums[i] + x;
            if (l > end) {
                ++ans;
                start = l;
                end = r;
            } else {
                start = Math.max(l, start);
                end = Math.min(end, r);
            }
        }
        System.out.println(ans);
    }
}
